package com.hmdp.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RedissonConfig {

    @Bean
    public RedissonClient redissonClient() {
        // 配置---org.redisson.config
        Config config = new Config();
        // 集群配置
//        config.useClusterServers().addNodeAddress()
        config.useSingleServer().setAddress("redis://123.57.94.225:6379")
                .setPassword("1234");
        return Redisson.create(config);
    }
}
